<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	    		xmlns:ui="http://java.sun.com/jsf/facelets"
	  			xmlns:h="http://java.sun.com/jsf/html"
	  			xmlns:f="http://java.sun.com/jsf/core"
	  			xmlns:sf="http://www.springframework.org/tags/faces"
				template="/WEB-INF/layouts/standardLayout.xhtml">

<ui:define name="content">
		<div id="connections" class="section">
		    <span class="errors">
		       <h:messages errorClass="errors" globalOnly="true" />
		    </span>
			<h2>
				<h:outputText value="#{msg.connection_properties}"/>
			</h2>
			<h:form id="mainForm">
				<fieldset>
					<div class="field">
						<div class="label">
							<h:outputLabel for="somConfig">Connection:</h:outputLabel>
						</div>
						<div class="input">
							<h:selectOneMenu id="somConfig" value="#{connectionConfiguration.selectedConnectionName}">
						       	<f:selectItems value="#{connectionConfiguration.connections}"/>
							</h:selectOneMenu>
						</div>
					</div>
					<div class="field">
						<div class="label">
							<h:outputLabel for="itUrl">JDBC Url:</h:outputLabel>
						</div>
						<div class="input">
							<sf:clientTextValidator promptMessage="Input jdbc url">
								<h:inputText id="itUrl" value="#{connectionConfiguration.url}" />
							</sf:clientTextValidator>
						</div>
					</div>
					<div class="field">
						<div class="label">
						   	<h:outputLabel for="itUserName">User name:</h:outputLabel>
						</div>
						<div class="input">
							<sf:clientTextValidator promptMessage="User name">
								<h:inputText id="itUserName" value="#{connectionConfiguration.username}" />
							</sf:clientTextValidator>
				   		</div>
					</div>
					<div class="field">
						<div class="label">
						   	<h:outputLabel for="itUserPassword">Password:</h:outputLabel>
						</div>
						<div class="input">
							<sf:clientTextValidator promptMessage="Pasword">
								<h:inputSecret id="itUserPassword" value="#{connectionConfiguration.password}" />
							</sf:clientTextValidator>
				   		</div>
					</div>
                    <div class="field">
                        <div class="label">
                            <h:outputLabel for="itSchemaName">Schema name:</h:outputLabel>
                        </div>
                        <div class="input">
                            <sf:clientTextValidator promptMessage="Schema name">
                                <h:inputSecret id="itSchemaName" value="#{connectionConfiguration.schemaName}" />
                            </sf:clientTextValidator>
                        </div>
                    </div>
					<div class="buttonGroup">
						<sf:commandButton id="cbEdit" value="#{msg.connection_editButton}" processIds="mainForm" action="edit" />
						<sf:commandButton id="cbExportImport" value="#{msg.connection_importButton}" processIds="mainForm" action="importexport" />
					</div>
			    </fieldset>
			</h:form>			  
		</div>

</ui:define>
</ui:composition>